import { ColumnGroupType, ColumnType } from "antd/es/table"

import { renderNullableValue } from "./venueProfitAndLoss"

const agentAndLossRakingColumns = (
	newFormat: (arg: string) => string
): Record<string, ColumnGroupType<any> | ColumnType<any>> => ({
	topProxyRank: {
		key: "topProxyRank",
		dataIndex: "topProxyRank",
		render: renderNullableValue("topProxyRank"),
		title: newFormat("report.alr_topProxyRank"),
		align: "center",
		fixed: false
	},
	topProxyName: {
		key: "topProxyName",
		dataIndex: "topProxyName",
		width: 120,
		render: renderNullableValue("topProxyName"),
		title: newFormat("report.alr_topProxyName"),
		align: "center",
		fixed: false
	},
	teamWithdrawable: {
		key: "teamWithdrawable",
		dataIndex: "teamWithdrawable",
		render: renderNullableValue("teamWithdrawable", "$"),
		title: newFormat("report.alr_teamWithdrawable"),
		align: "center",
		fixed: false
	},
	teamReturnLoan: {
		key: "teamReturnLoan",
		dataIndex: "teamReturnLoan",
		render: renderNullableValue("teamReturnLoan", "$"),
		title: newFormat("report.alr_teamReturnLoan"),
		align: "center",
		fixed: false
	},
	validBetAmount: {
		key: "validBetAmount",
		dataIndex: "validBetAmount",
		render: renderNullableValue("validBetAmount", "$"),
		title: newFormat("report.alr_validBetAmount"),
		align: "center",
		fixed: false
	},
	directlyMemberValidBetAmount: {
		key: "directlyMemberValidBetAmount",
		dataIndex: "directlyMemberValidBetAmount",
		render: renderNullableValue("directlyMemberValidBetAmount", "$"),
		title: newFormat("report.alr_directlyMemberValidBetAmount"),
		align: "center",
		fixed: false
	},
	teamRebateAmount: {
		key: "teamRebateAmount",
		dataIndex: "teamRebateAmount",
		render: renderNullableValue("teamRebateAmount", "$"),
		title: newFormat("report.alr_teamRebateAmount"),
		align: "center",
		fixed: false
	},
	netAmount: {
		key: "netAmount",
		dataIndex: "netAmount",
		render: renderNullableValue("netAmount", "$"),
		title: newFormat("report.alr_netAmount"),
		align: "center",
		fixed: false
	},
	creditQuota: {
		key: "creditQuota",
		dataIndex: "creditQuota",
		render: renderNullableValue("creditQuota", "$"),
		title: newFormat("report.alr_creditQuota"),
		align: "center",
		fixed: false
	},
	creditBalance: {
		key: "creditBalance",
		dataIndex: "creditBalance",
		render: renderNullableValue("creditBalance", "$"),
		title: newFormat("report.alr_creditBalance"),
		align: "center",
		fixed: false
	}
})

export default agentAndLossRakingColumns
